package com.lgb.DAO;

import com.lgb.pojo.Blog;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface BlogRepository extends JpaRepository<Blog, Long> , JpaSpecificationExecutor<Blog> {
    //查询博客标题或内容和query类似的
    @Query("select b from  Blog b where b.title like ?1 or b.content like ?1")
    Page<Blog> findByQuery(String query , Pageable pageable);
}
